using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_DataRightSchemaMap : EntityTypeConfiguration<t_DataRightSchema>
    {
        public t_DataRightSchemaMap()
        {
            // Primary Key
            this.HasKey(t => t.FSchemaID);

            // Properties
            this.Property(t => t.FFirstTableName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FFrom)
                .IsRequired();

            this.Property(t => t.FWhere)
                .IsRequired();

            this.Property(t => t.FContent)
                .IsRequired();

            this.Property(t => t.FUseKey)
                .IsRequired()
                .HasMaxLength(1500);

            // Table & Column Mappings
            this.ToTable("t_DataRightSchema");
            this.Property(t => t.FSchemaID).HasColumnName("FSchemaID");
            this.Property(t => t.FClassTypeID).HasColumnName("FClassTypeID");
            this.Property(t => t.FOperation).HasColumnName("FOperation");
            this.Property(t => t.FFirstTableName).HasColumnName("FFirstTableName");
            this.Property(t => t.FFrom).HasColumnName("FFrom");
            this.Property(t => t.FWhere).HasColumnName("FWhere");
            this.Property(t => t.FContent).HasColumnName("FContent");
            this.Property(t => t.FUseKey).HasColumnName("FUseKey");
            this.Property(t => t.FTypeID).HasColumnName("FTypeID");
        }
    }
}
